//
//  YMDownView.swift
//  YMSwiftUI
//
//  Created by anscen on 2022/4/15.
//
import SwiftUI

struct YMDownView: View {
    @State private var listData :[YMChapter] = []
    var body: some View {
        VStack {
            List(listData, id: \.self) { objc in
                NavigationLink {
                    YMDownContentView(chapter: objc)
                } label: {
                    YMChapterCell(title: objc.title, vip: false)
                }.padding(.zero)
            }.listStyle(.plain)
        }.onAppear {
            self.loadData()
        }.navigationTitle("我的下载").navigationBarBackButtonHidden(true).navigationBarItems(leading: BaseNavigationBarBackButton())
    }
    func loadData(){
        self.listData = GKRegular.txtBook("七界传说")
    }
}

